(C) December 9, 1994, Luke Bellandi. This library is a compilation of mouse routines along with the capability to control and monitor the CD-Audio capabilities of your CD-ROM. It was written and compiled in QuickBASIC 4.5. I do not know if the library will run in any other language. All of the files (executable and compilable) in QB 4.5. Files included: UTILS.BI UTILS.BAS UTILS.QLB UTILS.TXT CURSOR.BAS CDPLAYER.EXE CDPLAYER.DAT and seven .CSR files (mouse cursor graphics) Requirements: Mouse section: Microsoft compatable mouse Microsoft compatable mouse driver installed CD-Audio section: CD-ROM capable of playing audio CD's MSCDEX version 2.10 or higher installed Mouse function summary ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ 1) FUNCTION MI% () Called with: nothing Returns: MI% = -1 if Mouse is present and initialized MI% = 0 if Mouse not present or initialized 2) SUB Cursor (Status) Called with: 0 to hide cursor 1 to show cursor Returns: Cursor is shown or hidden 3) SUB MouseInfo (LB, RB, X, Y) Called with: nothing Returns: LB = -1 if the left mouse button is down LB = 0 if the left mouse button is up (RB corresponds in the same way with the right button) X = current mouse x coordinate ** Y = current mouse y coordinate ** 4) SUB MousePut (X, Y) Called with: X and Y coordinates ** Returns: puts mouse at specified location 5) SUB MouseRange (X1, Y1, X2, Y2) Called with: X1 and Y1 being the upper left hand corner of the box restricting the mouse and X2 and Y2 being the lower right hand corner of the box (working the same way the LINE (X1, Y1)-(X2, Y2), ,B command works. ** 6) SUB LoadCursor (FileName$,Offset) Called with: FileName$ = full name of file with mouse cursor data in it (size = 65 bytes) Offset = start of mouse data in file (usually 1) Returns: Mouse cursor changed. Note: Mouse cursors can be made and saved in the CURSOR.BAS program which is described later in this file. ** with mouse functions that return and send X and Y values, the X value is always from 0-639, and the Y value corresponds with the Y extent of the the current screen mode. CD Function summary ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ 1) SUB MSCDEXProfile (Drives, Driveletter, MSCDEXver) Called with: nothing Returns: Drives = number of CD-ROM drives on computer If Drives = 0, MSCDEX is not installed. DriveLetter = drive letter of the first CD-ROM alphabetically (0 = A, 1 = B, 2 = C, etc...) MSCDEXver = version of MSCDEX currently installed and running 2) SUB CDPlay (Track, Minutes, Seconds, Frames, Length) Called with: Track = the track to be played Minutes = number of minutes into track Seconds = number of seconds into track Frames = number of frames into track (1 frame = 1/75th of a second) Length = how far to play on CD (a value of -1 plays to the end of CD) -Formula of Length- 4500 * Minutes + 75 * Seconds + Frames Returns: CD plays (if one is in drive and initialized) 3) SUB CDFunction (Command) Called with: Command 0 = Pause / Stop CD 1 = Unpause CD 2 = Lock CD-Drive 3 = Unlock CD-Drive 4 = Eject CD 5 = Close tray (if capable) Returns: Command completed (if applicable) 4) SUB CDInfo (LoTrack, HiTrack, CDTime$) Called with: nothing Returns: LoTrack = the first track number on disc HiTrack = the last track number on disc (NumberOfTracks = HiTrack - LoTrack + 1) CDTime$ = Length of CD in "MM:SS:FF" form (minutes:seconds:frames) 5) SUB TraxInfo (TrackTime$()) *** TrackTime$ must be dimensioned with the number of tracks on disc + 1 before this SUB can be called. Called with: nothing Returns: TrackTime$(1) = "MM:SS" of track 1, etc. *** TrackTime$(X) will have CHR$(219) at the end of it (e.g. "4:56Û") if track X is a data track, and does not contain CD-Audio data. 6) SUB CDTime (Track, CurrentTime$, Options) Called with: Options = -1 to get the time from beginning of CD. Options = 0 to get the time from beginning of current track. Returns: Track = current track being played CurrentTime$ = current time of CD being played (from beginning of CD or track, whichever one was specified in variable 'Options'. This value is in "MM:SS" (minutes:seconds) form. Options = current frame (1/75th of a second) of CD being played. 7) SUB CDStatus (Opened, Locked, Audio, DiscPresent) Called with: nothing **** Returns: Opened = -1 if the CD drive door is open. Locked = -1 if the CD drive is locked. Audio = -1 if the CD drive is capable of playing audio CD's. DiscPresent = -1 if there is a disc currently inserted and initialized in the CD drive. **** if any of these values is untrue, its value is equal to 0. 8) SUB Driver (CommandCode, Segment, Pointer, Length, ErrorCode) This sub is used internally, you need not use it at all. 9) SUB INTERRUPTX (Interrupt, InReg as RegTypeX, OutReg as RegTypeX) This sub is included in the QuickBASIC library supplied with QB 4.5 and is absolutely required for every function in this library. CURSOR.BAS ÄÄÄÄÄÄÄÄÄÄÄÄ The CURSOR.BAS file was created so that you may create cursors for use with your mouse, and not have to use the default arrow. specs: Cursor size = 16*16 pixels x(0-15), y(0-15) Colors = black(0), white(1), or the background(2) in the cursor maker, the background is a blue color, but when actually used, will show through whatever is behind it. Hot spot: the point on the cursor that will be returned when MouseInfo is called (x values from 0-15, y values from 0-15) When saving or loading a file, only give the name. A '.CSR' extention will be added automatically. I have included several cursor files, including the one used in CDPLAYER.EXE. When you load these files into your program, you must include the extention. E.g. LoadCursor "ARROW.CSR", 1 (1 being where to start getting information in the file ARROW.CSR) CDPLAYER.EXE ÄÄÄÄÄÄÄÄÄÄÄÄÄÄ This file allows you to play Audio CDs using functions from this library. I have edited all of the errors (hopefully) out of it since the last version. This quick library is freeware, but I take no responsibility whatsoever for any damage caused by it. Even though I have had no trouble with it whatsoever. To run UTILS.BAS, you must load up QuickBASIC with the quick library UTILS.QLB first. If you would like the UTILS.LIB file to use in compiling your programs, you will need to E-mail Luke Bellandi (me) on CompuServe at ID #74463, 3120